<?php
session_start();
require_once dirname(dirname(__FILE__)) . '/shared/config/config.php';
require_once DOCUMENT_ROOT . DIR_SHARED_API . 'api_tickets.php';

$ticket_id = filter_input(INPUT_POST, "ticket_id");

$_SESSION['book_info']['ticket_id'] = $ticket_id;

$ticket = api_tickets::get_ticket_by_id($ticket_id);

$text = "No chosen.";
if (!empty($ticket)) {
    $date = date_create($ticket['time_start']);
    $text = $ticket['cinema_name'] . " - " . date_format($date, "H:i");
}
echo $text;